<?php
Yii::app()->clientScript->registerScriptFile('http://static.wowhead.com/widgets/power.js');
//Yii::app()->clientScript->registerScriptFile('http://d3db.com/static/js/external.js');
$script_info = 'var wowhead_tooltips = { "colorlinks": true, "iconizelinks": true, "renamelinks": true }';
Yii::app()->clientScript->registerScript('wowhead', $script_info, CClientScript::POS_HEAD);
?>
<a href="http://www.d3db.com/item/i/anessazi-edge">D3</a>
<a href="#" rel="item=96890" class="q3">wow items</a>
<a href="http://www.wowhead.com/item=96890" class="q3">[Felstalker Bracers]</a>
<a href="http://www.wowhead.com/item=3075"><img src="icon.gif"></a>
<dl class="content-box">
    <dt class="title"><h3>Featured Product</h3></dt>
    <dd class="info">
        <ul class="category-list">
            <?php
            foreach ($hot_category as $v):
                if (isset($v['master'])) {
                    $url = $this->createCategoryUrl(array('master' => $v['master']->title_alias, 'alias' => $v['category']->title_alias), $v['category']->product_model);
                } else {
                    $url = $this->createCategoryUrl(array('alias' => $v['category']->title_alias), $v['category']->product_model);
                }
                ?>
                <li class="pull-left">
                    <a href="<?php echo $url; ?>">
                        <img src="<?php echo Yii::app()->baseUrl; ?>/<?php echo $v['category']->thum; ?>" />
                        <strong><?php echo $v['category']->title; ?></strong>
                    </a>
                </li>
                <?php
            endforeach;
            ?>

            <li class="clearfix"></li>
        </ul>
    </dd>
</dl>
<hr/>
<dl class="content-box">
    <dt class="title"><h3>News</h3></dt>
    <dd class="info">
        <ul class="news-list">
            <?php
            foreach ($news as $v):
                if (Yii::app()->cache->get('c-' . $v->info_sort)) {
                    $category = Yii::app()->cache->get('c-' . $v->info_sort);
                } else {
                    $category = SubsiteCategory::model()->findByAttributes(array('infosort_id' => $v->info_sort));
                    Yii::app()->cache->set('c-' . $v->info_sort, $category);
                }
                ?>
                <li><a href="<?php echo Yii::app()->createAbsoluteUrl('news/view', array('master' => $category->title_alias, 'alias' => $v->url_alias)); ?>"><?php echo $v->info_title; ?></a> <?php echo date('m/d/Y', strtotime($v->option_date)); ?></li>
                <?php
            endforeach;
            ?>

        </ul>
    </dd>
</dl>
